package filemanagement;

import java.io.File;

import javax.swing.filechooser.*;

import utilities.Utils;

public class ProblemFilter extends FileFilter {

	@Override
	public boolean accept(File f) {
        if (f.isDirectory()) {
            return true;
        }
 
        String extension = Utils.getExtension(f);
        if (extension != null) {
            if (extension.equals(Utils.arff) ||
                (extension.equals(Utils.col))) {
                    return true;
            } else {
                return false;
            }
        }
 
        return false;

	}

	@Override
	public String getDescription() {
		return "Problem Definition Files (.arff; .col)";
	}

}
